<template>
  <div class="app-container">
    <!-- 数据列表 -->
    <el-table
      ref="table"
      v-loading="crud.loading"
      max-height="420"
      :data="crud.data"
      row-key="pkId"
    >
      <el-table-column prop="sourceTableName" label="源表" width="200" />
      <el-table-column prop="targetTableName" label="目标表" width="200" />
      <el-table-column prop="bizDate" label="数据日期" width="150" />
      <el-table-column prop="contrastAnalysisResult" label="分析结果" width="150" />
      <el-table-column prop="oneselfAnalysisResult" label="自身结果" />
    </el-table>
    <pagination />
  </div>
</template>

<script>
import CRUD, { presenter, header, crud } from '@crud/crud'
import pagination from '@crud/Pagination'

const defaultCrud = CRUD({
  title: '脚本数据分析结果',
  url: 'api/script/test/data/analysis'
})
export default {
  components: { pagination },
  mixins: [presenter(defaultCrud), header(), crud()],
  props: {
    testScriptListPkId: {
      type: String
    },
    testScriptTaskPkId: {
      type: String
    }
  },
  data() {
    return {}
  },
  methods: {
    [CRUD.HOOK.beforeRefresh](crud) {
      if (this.$props.testScriptTaskPkId) {
        crud.query.testScriptTaskPkId = this.$props.testScriptTaskPkId
      }
      if (this.$props.testScriptListPkId) {
        crud.query.testScriptListPkId = this.$props.testScriptListPkId
      }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>

</style>
